<script setup>
import gsap from 'gsap';
import { ref, watch, reactive } from 'vue'
const props = defineProps({
  value: {
    type: Number,
    default: 0
  }
})
const d = ref({
  num: 0
})
const AnimateToValue = () => {
  gsap.to(d.value, {
    duration: 0.5,
    num: props.value
  })
}
AnimateToValue()
watch(() => props.value, () => AnimateToValue())
</script>
<template>
  {{ d.num.toFixed(0) }}
</template>